#include "Log.hpp"
#include "ThreadPool.hpp"
#include <memory>
using namespace LogModule;
using namespace ThreadPoolModule;

using task_t = std::function<void()>;

void Download()
{
   LOG(LogLevel::DEBUG) << "我是一个下载任务...";
}

int main()
{
    //Test1
    //std::unique_ptr<LogStratgy> strategy = std::make_unique<ConsoleStrategy>();
    //std::unique_ptr<LogStratgy> strategy = std::make_unique<FileLogStrategy>();
    //strategy->SyncLog("hello world");

    //Test2
    //logger.EnableFileLogStrategy();
    //logger(LogLevel::DEBUG,"main.cc",10)<<"hello"<<3.14<<" "<<10<<" "<<"hehe";

    //Test3
    // Enable_Console_Log_Strategy();
    // LOG(LogLevel::DEBUG) << "hello" << 100 ;
    // Enable_File_Log_Strategy();
    // LOG(LogLevel::INFO) << "world" << 100 ;

    Enable_Console_Log_Strategy();
    ThreadPool<task_t>* _tp = new ThreadPool<task_t>();
    _tp->Start();
    _tp->Enqueue(Download);
    sleep(2);
    _tp->Stop();
    _tp->Join();

    return 0;
}